package com.wlr.study.leetcode;

/**
 * 翻转二叉树
 */
public class LeetCode226 {
    public TreeNode invertTree(TreeNode root) {
        if(root==null){
            return null;
        }
        TreeNode left = root.left;
        root.left= root.right;
        root.right=left;
        invertTree(root.left);
        invertTree(root.right);
        return root;
    }
}
